<?php

class PositiveVoteTable extends Doctrine_Table {
    public function hasVoted($user,$article_id) {
	$q = $this->createQuery('v')
		->where('v.user_id=?',$user->getAttribute('id'))
		->andWhere('v.article_id=?',$article_id);
	if ($q->fetchOne()) {
	    return true;
	} else {
	    return false;
	}

    }
}
